//
//  PersonManageTableViewCell.m
//  CityFire
//
//  Created by Liuyz on 2017/8/3.
//  Copyright © 2017年 刘养柱. All rights reserved.
//

#import "PersonManageTableViewCell.h"

@interface PersonManageTableViewCell ()

@property (nonatomic, weak) IBOutlet UILabel *userNameLabel;
@property (nonatomic, weak) IBOutlet UILabel *loginUserLabel;
@property (nonatomic, weak) IBOutlet UILabel *statusLabel;
@property (nonatomic, weak) IBOutlet UILabel *postLabel;
@property (nonatomic, weak) IBOutlet UILabel *jobLabel;
@property (nonatomic, weak) IBOutlet UILabel *deviceCountLabel;
@property (nonatomic, weak) IBOutlet UILabel *emailLabel;
@property (nonatomic, weak) IBOutlet UIButton *devieBut;

@end

@implementation PersonManageTableViewCell

- (void)setPersonInfoModel:(PersonInfoModel *)personInfoModel
{
    self.userNameLabel.text = [NSString stringWithFormat:@"用户名:%@", personInfoModel.CHNUSERNAME];
    self.loginUserLabel.text = [NSString stringWithFormat:@"登录用户名:%@", personInfoModel.ENGUSERNAME];
    self.statusLabel.text = [personInfoModel.STATUS isEqualToString:@"1"] ? @"启用" : @"暂停";
    //     1 启用 0 暂停
    self.statusLabel.textColor = [personInfoModel.STATUS isEqualToString:@"1"] ? [UIColor greenColor] : [UIColor orangeColor];

    self.postLabel.text = [NSString stringWithFormat:@"职务:%@", personInfoModel.ROLE];
    self.jobLabel.text = [NSString stringWithFormat:@"角色:%@", personInfoModel.DUTY];
    self.deviceCountLabel.text = [NSString stringWithFormat:@"可查看设备:%@", personInfoModel.DEVICECOUNT];
    self.emailLabel.text = [NSString stringWithFormat:@"公司邮箱:%@", personInfoModel.EMAIL];
}


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    self.devieBut.layer.cornerRadius = 5.0f;
}


@end
